#include <iostream>
#include <cstring>
using namespace std;
using ll=long long;
using ull=unsigned ll;
const ull base=131;
const int N=1e6+10;

ull h1[N],h2[N];
ull b[N];
ull getHash(ull h[],int l,int r){
   return h[r]-h[l-1]*b[r-l+1];
}

int main()
{
	string s1,s2;
	cin>>s1>>s2;
	int m=s1.size(),n=s2.size();
	s1=' '+s1;
	s2=' '+s2;
	b[0]=1;
	
	for(int i=1;i<=m;i++)
	{
		h1[i]=h1[i-1]*base+(int)s1[i];
	}
	for(int i=1;i<=n;i++)
	{
		h2[i]=h2[i-1]*base+(int)s2[i];
		b[i]=b[i-1]*base;
	}

	ull hs_s1=getHash(h1,1,m);
	int ret=0;
	for(int i=1;i<=n-m+1;i++)
	{
		if(getHash(h2,i,i+m-1)==hs_s1)
			ret++;
			
	}
	cout<<ret<<endl;
	return 0;
}
